Skip to content

Work around upstream compiler bug#956

Merged
kylebarron merged 4 commits intomainfrom
kyle/work-around-compiler-bug
Dec 20, 2024
Merged

Work around upstream compiler bug#956
kylebarron merged 4 commits intomainfrom
kyle/work-around-compiler-bug

Conversation

@kylebarron
Copy link
Copy Markdown
Member

@kylebarron kylebarron commented Dec 20, 2024

Closes #716. Ref georust/geo#1255 (comment).

Note that this is the same underlying implementation as upstream geo in georust/geo#1255. However, the trait-based implementation hits this compiler regression rust-lang/rust#128887, rust-lang/rust#131960, which prevents from compiling in release mode on a stable Rust version. For some reason, the function-based implementation does not hit this regression, and thus allows building geoarrow without using latest nightly and a custom RUSTFLAGS.

Note that it's only GeometryTrait and GeometryCollectionTrait that hit this compiler bug.
Other traits can use the upstream impls.

@kylebarron kylebarron marked this pull request as ready for review December 20, 2024 16:30
@kylebarron kylebarron merged commit b4bc4f0 into main Dec 20, 2024
@kylebarron kylebarron deleted the kyle/work-around-compiler-bug branch December 20, 2024 17:25
Kontinuation added a commit to wherobots/geo that referenced this pull request Sep 25, 2025
… Rust compiler bug in 1.90.0 (#11)

This patch removes the GAT `GeometryCollectionTypeExt` from `GeometryTraitExt` because it would introduce recursive GATs such as `G::GeometryCollectionTypeExt::GeometryTypeExt::GeometryCollectionTypeExt::...` and easily
trigger a Rust compiler bug: rust-lang/rust#128887 and rust-lang/rust#131960. See also geoarrow/geoarrow-rs#1339.

Although this could be worked around by not implementing generic functions using trait-based approach and use
function-based approach instead, see geoarrow/geoarrow-rs#956 and georust/wkb#77, we are not certain if there will be other issues caused by recursive GATs in the future. So we decided to completely get rid of recursive GATs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compile error for release builds on nightly: overflow evaluating the requirement `<impl GeometryTrait<T = f64>

1 participant